<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/7
 * Time: 0:25
 */

namespace app\common\model;

use think\Model;

class Base extends Model
{

    /**
     * 新增
     * @param $data
     * @return mixed
     */
    public function add($data){
        if (!is_array($data)){
            exception('传递数据不合法');
        }
        $this->allowField(true)->save($data);
        return $this->id;
    }

}